home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir26 / epi601_2.zip / FILES06.EXE / ENTFACE.ASM < prev    next >
Assembly Source File  |  1994-08-22  |  3KB  |  69 lines

  1. ;======================================================================
  2. ;   This program demonstrates the calling sequence for a user-supplied
  3. ; module for the ENTER program.  The procedure must a binary file with
  4. ; its entry point at location 0 in the file.  The ENTER program passes
  5. ; the following information in the locations specified (assuming the
  6. ; routine does the standard PUSH BP   MOV  BP,SP on entry):
  7. ;
  8. ;    [BP+20] - A pointer to the questionnaire's record structure
  9. ;    [BP+16] - A pointer to the global variable list
  10. ;    [BP+12] - A pointer to the questionnaire's circular list header
  11. ;    [BP+08] - A pointer to the current node in the questionnaire
  12. ;    [BP+06] - An integer specified in the .CHK file to be passed
  13. ;
  14. ;   The program is expected to return a value in AX as follows:
  15. ;     0 - No error
  16. ;     1 - Make user enter field again
  17. ;======================================================================
  18.             ORG       0
  19. _Prog       SEGMENT   Byte
  20.             ASSUME    CS:_Prog
  21.  
  22. Custom      PROC      FAR
  23.             PUSH      BP
  24.             MOV       BP,SP
  25.             MOV       AX,WORD PTR [BP+06]     ;Get interrupt number
  26.             PUSH      DS                      ;Save DS
  27.             MOV       AH,35h                  ;Get interrupt function num
  28.             INT       21h                     ;Call dos
  29.             ADD       BX,5                    ;Increment offset by 5
  30.             MOV       DI,BX                   ;Set up for CMPS
  31.             MOV       DX,CS                   ;Load code segment address
  32.             MOV       DS,DX                   ;Load to DS
  33.             MOV       SI,OFFSET IdString      ;Load IDString address to DS:SI
  34.             MOV       CX,5                    ;Length of ID string
  35.             CLD
  36. REPE        CMPSB
  37.             JNE       ErrorRet                ;If not the right ID, exit
  38.             MOV       AX,ES:[DI]              ;Get old value of DS to AX
  39.             ADD       DI,2                    ;Increment to point to routine
  40.             LDS       SI,[BP+20]              ;Get parameters and push back
  41.             PUSH      DS
  42.             PUSH      SI
  43.             LDS       SI,[BP+16]
  44.             PUSH      DS
  45.             PUSH      SI
  46.             LDS       SI,[BP+12]
  47.             PUSH      DS
  48.             PUSH      SI
  49.             LDS       SI,[BP+08]
  50.             PUSH      DS
  51.             PUSH      SI
  52.             MOV       BX,[BP+06]
  53.             PUSH      BX
  54.             MOV       DS,AX                   ;Restore old DS
  55.             CALL      DWORD PTR ES:[DI]       ;Call far to correct location
  56.             JMP       SHORT Return            ;Skip over error result set
  57.  
  58. ErrorRet:   MOV       AX,4                    ;Set error value
  59. Return:     POP       DS                      ;Restore Enter's DS
  60.             POP       BP
  61.             RETF      18
  62.  
  63. IDString    DB        'ENTER'
  64.  
  65. Custom      ENDP
  66.  
  67. _Prog       ENDS
  68.             END
  69.